package com.zh.freechat.domain.connect;

import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 每个节点的监控数据
 *
 * @author Zhou
 * @date 16:11 2024/12/22
 */
@Data
public class NodeUsersData implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 服务节点name
     */
    @Setter(AccessLevel.PRIVATE)
    private String nodeName;

    /**
     * 时间戳
     */
    @Setter(AccessLevel.PRIVATE)
    private long timestamp;

    /**
     * 连接的channel数量
     */
    private int channelCount;

    /**
     * 在线用户列表
     */
    private List<String> onlineUsers;

    public NodeUsersData() {
    }

    public NodeUsersData(String nodeName, long timestamp) {
        this.nodeName = nodeName;
        this.timestamp = timestamp;
    }

}
